package com.ccp.dev.system.controller;

import com.ccp.dev.core.basic.annotion.Action;
import com.ccp.dev.core.basic.consts.UrlConstants;
import com.ccp.dev.core.basic.internationalization.SysBaseController;
import com.ccp.dev.core.basic.model.SysAuditModelType;
import com.ccp.dev.core.basic.response.ResultData;
import com.ccp.dev.system.service.SubSystemService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 子系统管理 控制器类
 * @author y
 */
@Controller
@Action(ownermodel = SysAuditModelType.ROLE_MANAGEMENT)
@RequestMapping(UrlConstants.PROJECT_ROOT+UrlConstants.PROJECT_MODULE_SYSTEM+"/subSystem")
public class SubSystemController extends SysBaseController
{
	@Resource
	private SubSystemService subSystemService;

	/**
	 * 查询被激活的系统
	 * @return list
	 */
	@ResponseBody
	@Action(description = "查询被激活的子系统", exectype = "查询日志")
	@GetMapping("queryActiveSystem_simple")
	public ResultData queryActiveSystem_simple(){
		try{
			List<Map> list = subSystemService.queryActiveSystem_simple();
			return getResultDataSuccess("operation.success",0,list);
		}catch (Exception e){
			return getResultDataError("operation.failure");
		}
	}
}


